﻿using Commom;
using EF_Brave.Service.Logging;
using EF_Brave.Service.Logging.Service;
using System;
using System.Collections.Generic;
using System.Linq;

namespace FD.TradingCenter.Infrastructure.Logging
{
    /// <summary>
    /// 系统日志工厂
    /// </summary>
    /// <remarks>
    /// 用于获取ILogger，以便进行系统日志记录
    /// </remarks>
    public static class LoggerBLL
    {

        /// <summary>
        /// 依据LoggerName获取
        /// </summary>
        /// <param name="loggerName">日志名称</param>
        /// <returns>实现ILogger接口的对象</returns>
        public static ILogger GetLogger(string loggerName)
        {
            var loggerFactoryAdapter = DIContainer.Resolve<ILoggerFactoryAdapter>();
            return loggerFactoryAdapter.GetLogger(loggerName);
        }

        /// <summary>
        /// 获取logger name为FDTradingCenter的日志
        /// </summary>
        /// <returns>实现ILogger接口的对象</returns>
        public static ILogger GetLogger()
        {
            return GetLogger("Logger");
        }
    }
}
